<%-- 
    Document   : search_emp
    Created on : Nov 4, 2013, 4:48:31 PM
    Author     : zraj
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags"%>
<script type="text/javascript">
            $.subscribe('rowselect', function(event, data) {
                //alert('Selected Row : ' + event.originalEvent.id);
                $('#hidEmpId').val(event.originalEvent.id);
                $('#form-emp-detail').submit();
            });
</script>

</script>

<s:form id="form-emp-detail" action="showDetailEmp">
    <s:hidden value="" id="hidEmpId" name="empID" ></s:hidden>
    
</s:form>

<s:url id="remoteurl" action="searchEmpJson" namespace="/grid"/>
<sjg:grid
    id="gridtable"
    caption="Search Employee"
    dataType="json"
    href="%{remoteurl}"
    pager="true"
    gridModel="myEmps"
    rowList="10,15,20"
    rowNum="15"
    rownumbers="true"
    navigator="true"
    navigatorSearch="true"
    navigatorDelete="false"
    navigatorAdd="false"
    navigatorEdit="false"
    onSelectRowTopics="rowselect"
    >

    <sjg:gridColumn name="empId" searchoptions="{sopt:['eq','cn']}" key="true" index="empId" title="รหัสพนักงาน" sortable="false"/>
    <sjg:gridColumn name="nameTH" searchoptions="{sopt:['eq','cn']}" index="nameTH" title="ชื่อ" sortable="false"/>
    <sjg:gridColumn name="surnameTH" searchoptions="{sopt:['eq','cn']}" index="surnameTH" title="สกุล" sortable="false"/>
    <sjg:gridColumn name="idcardNumber" searchoptions="{sopt:['eq','cn']}" index="idcardNumber" title="บัตรประชาชน" sortable="false"/>
</sjg:grid>
